package com.service.impl;

import com.dao.UserDao;
import com.pojo.User;
import com.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    UserDao userDao;

    public List<User> getUserAll() {

        List<User> users = userDao.UserAll();
        return users;
    }

    public User getUserById(int id) {
        return userDao.getUserById(id);
    }

    public int delUserById(int id) {
        return userDao.delUser(id);
    }

    public int editUserById(User user) {
        return userDao.editUser(user);
    }
    public int addUserById(User user) {
        return userDao.addUser(user);
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }
}
